package com.thb.pay.manage.comm.utils;

/**
 * @Description 管理平台参数
 * @Author lucky
 * @data 2019/7/28 21:43
 */
public class AdminConstants {

    public static String CACHE_ACCESS_TOKEN_KEY = "manage:access:token:%s";

    public static String CACHE_REFRESH_TOKEN_KEY = "manage:refresh:token:%s";

    public static Integer CACHE_MANAGE_USER_TIME_KEY = 60 * 60 * 24;//缓存用户时间 一天

    public static Integer CACHE_LOCK_TIME = 60 * 60;// 锁住一个小时 错误三次锁

    public static Integer DEFAULT_COUNT = 1;

    public static Integer MAX_ERROR_USER_COUNT = 3;//登入最大错误次数

    public static String LOCKED_MANAGE_USER_KEY = "locked:manage:user:%s";


    public static String CACHE_MANAGE_NAME = "cacheManageUser";

    public static String CACHE_MANAGE_USER_KEY = "manage:user:%s";

    public static String CACHE_MANAGE_USE_ERROR_COUNT_KEY = "manage:user:error:count:%s";//用户错误次数

    public static String getCacheAccessTokenKey(String accessToken) {
        return String.format(CACHE_ACCESS_TOKEN_KEY, accessToken);
    }

    public static String getCacheRefreshTokenKey(String refreshToken) {
        return String.format(CACHE_REFRESH_TOKEN_KEY, refreshToken);
    }
}
